package com.robotic.device.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.robotic.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.robotic.device.mapper.DeviceManagementMapper;
import com.robotic.device.domain.DeviceManagement;
import com.robotic.device.service.IDeviceManagementService;

/**
 * 器件检测位置管理Service业务层处理
 *
 * @author tian
 * @date 2025-09-24
 */
@Service
public class DeviceManagementServiceImpl extends ServiceImpl<DeviceManagementMapper, DeviceManagement> implements IDeviceManagementService
{
    @Autowired
    private DeviceManagementMapper deviceManagementMapper;

    /**
     * 查询器件检测位置管理
     *
     * @param id 器件检测位置管理主键
     * @return 器件检测位置管理
     */
    @Override
    public DeviceManagement selectDeviceManagementById(Long id)
    {
        return deviceManagementMapper.selectDeviceManagementById(id);
    }

    /**
     * 查询器件检测位置管理列表
     *
     * @param deviceManagement 器件检测位置管理
     * @return 器件检测位置管理
     */
    @Override
    public List<DeviceManagement> selectDeviceManagementList(DeviceManagement deviceManagement)
    {
        return deviceManagementMapper.selectDeviceManagementList(deviceManagement);
    }

    /**
     * 新增器件检测位置管理
     *
     * @param deviceManagement 器件检测位置管理
     * @return 结果
     */
    @Override
    public int insertDeviceManagement(DeviceManagement deviceManagement)
    {
        deviceManagement.setCreateTime(DateUtils.getNowDate());
        return deviceManagementMapper.insertDeviceManagement(deviceManagement);
    }

    /**
     * 修改器件检测位置管理
     *
     * @param deviceManagement 器件检测位置管理
     * @return 结果
     */
    @Override
    public int updateDeviceManagement(DeviceManagement deviceManagement)
    {
        deviceManagement.setUpdateTime(DateUtils.getNowDate());
        return deviceManagementMapper.updateDeviceManagement(deviceManagement);
    }

    /**
     * 批量删除器件检测位置管理
     *
     * @param ids 需要删除的器件检测位置管理主键
     * @return 结果
     */
    @Override
    public int deleteDeviceManagementByIds(Long[] ids)
    {
        return deviceManagementMapper.deleteDeviceManagementByIds(ids);
    }

    /**
     * 删除器件检测位置管理信息
     *
     * @param id 器件检测位置管理主键
     * @return 结果
     */
    @Override
    public int deleteDeviceManagementById(Long id)
    {
        return deviceManagementMapper.deleteDeviceManagementById(id);
    }
}
